# Filename: exception.py

# import sys
# 
# try:
#     s = raw_input('Enter some characters:')
# 
# except EOFError:
#     print 'EOF not allowed!'
#     sys.exit()
# 
# except:
#     print 'Some error/exception occurred!'
# 
# else:
#     print 'Everything is fine. No exception.'
# 
# print 'DONE'

# class ShortInputException(Exception):
#     '''A user-defined exception class.'''
#     def __init__(self, length, at_least):
#         Exception.__init__(self)
#         self.length = length
#         self.at_least = at_least
# 
# try:
#     s = raw_input('Enter: ')
#     if len(s) < 3:
#         raise ShortInputException(len(s), 3)
# 
# except EOFError:
#     print 'EOF not allowed!'
# 
# except ShortInputException, x:
#     print 'ShortInputException: Input length %d, at least %d' % (x.length, x.at_least)
# 
# else:
#     print 'No exception raised.'

import time as t

try:
    f = file('poem.txt')
    while True:
        line = f.readline()
        if len(line) == 0:
            break
        t.sleep(2)
        print line,

finally:
    f.close()
    print 'Cleaning up...Closed the file.'
